package com.spark.common.core.entity.system;

import com.baomidou.mybatisplus.annotation.OrderBy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spark.common.annotation.Dict;
import com.spark.common.annotation.query.Query;
import com.spark.common.constants.QueryConstants;
import com.spark.common.core.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 系统数据字典项
 *
 * @author LYCHEE
 * @date 2025/02/20 10:21
 */
@Data
@TableName("sys_dict_item")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class SysDictItem extends BaseEntity {

    /**
     * 字典ID
     */
    @Query
    @NotBlank(message = "字典ID不能为空")
    private java.lang.String dictId;

    /**
     * 字典项文本
     */
    @Query(QueryConstants.QUERY_LIKE)
    @NotBlank(message = "字典项文本不能为空")
    private java.lang.String itemText;

    /**
     * 字典项值
     */
    @NotBlank(message = "字典项值不能为空")
    private java.lang.String itemVal;

    /**
     * 备注
     */
    private java.lang.String remark;

    /**
     * 状态
     *  : 0正常 1禁用
     */
    @Query
    @NotNull(message = "状态不能为空")
    @Dict(dictCode = "status")
    private java.lang.Integer status;

    /**
     * 展示样式
     *  : 0无 1点 2标签
     */
    private java.lang.Integer showStyle;

    /**
     * 展示样式颜色
     */
    private java.lang.String showStyleColor;

    /**
     * 排序
     */
    @OrderBy(asc = true, sort = 1)
    private java.lang.Integer sortRank;

    /**
     * 字典Code
     */
    @TableField(exist = false)
    private java.lang.String code;
}
